
<?php
	$data_creazione = date("d-m-Y" ,$gallery['data_creazione']) ;
	$data_modifica = date("d-m-Y" ,$gallery['data_modifica']) ;
	$permessi = $gallery['permessi'] ;
	if($permessi=="1") $permessi_str = "Gallery visibile a tutti";
	if($permessi=="2") $permessi_str = "Gallery visibile solo agli amici";
	if($permessi=="3") $permessi_str = "Gallery visibile solo a te";
	?>
<table cellspacing=0 cellpadding=0 border=0 width=100%>
	<tr><td class="proprietario_bacheca">Gallery Partners</td>
	<td align=right valign="bottom" class="link_10"><a href="javascript:gallery.carica_img()" class="link_10">Aggiungi Immagini</a></td>
	</tr>
	<tr><td height=10></td></tr>
	<tr><td colspan=2 height=1 bgcolor ="#285885"></td>
	</tr>
	<tr><td height=5><input type="hidden" id="id_cat_gallery" value="<?php echo $id_gallery ; ?>"></td></tr>
	
	
	
	
	<tr><td height=10></td></tr>
	<tr><td height=10 colspan=2 id="elenco_gallery"></td></tr>
	<tr><td height=10></td></tr>
	
</table>

<div id="contenitore_caricamento_img">
	<form>
		<div style="width: 220px; height: 18px; border: solid 1px #7FAAFF; background-color: #C5D9FF; padding: 2px;">
			<span id="spanButtonPlaceholder"></span>
		</div>
	</form>
	<div id="divFileProgressContainer" style="height: 75px;"></div>
</div>

<div id="contenitore_modifica_gallery">
	
</div>

<script language="javascript">
	// Questa è la parte che viene sparata all'avvio
$(function() {
	
	var swfu;
		
	swfu = new SWFUpload({
		// Backend Settings
		upload_url: "<?php echo base_url()."gallery/upload_file/".$id_gallery ; ?>",
		post_params: {"PHPSESSID": "<?php echo session_id(); ?>"},

		// File Upload Settings
		file_size_limit : "10 MB",
		file_types : "*.jpg; *.jpeg; *.JPEG; *.JPG; *.png",
		file_types_description : "JPG Images; PNG Image",
		file_upload_limit : 0,

		// Event Handler Settings - these functions as defined in Handlers.js
		//  The handlers are not part of SWFUpload but are part of my website and control how
		//  my website reacts to the SWFUpload events.
		swfupload_preload_handler : preLoad,
		swfupload_load_failed_handler : loadFailed,
		file_queue_error_handler : fileQueueError,
		file_dialog_complete_handler : fileDialogComplete,
		upload_progress_handler : uploadProgress,
		upload_error_handler : uploadError,
		upload_success_handler : uploadSuccess,
		upload_complete_handler : uploadComplete,

		// Button Settings
		button_image_url : "<?php echo base_url() ; ?>img/SmallSpyGlassWithTransperancy_17x18.png",
		button_placeholder_id : "spanButtonPlaceholder",
		button_width: 180,
		button_height: 21,
		button_text : '<span class="button">Aggiungi Immagini <span class="buttonSmall">(2 MB Max)</span></span>',
		button_text_style : '.button { font-family: Helvetica, Arial, sans-serif; font-size: 12pt; } .buttonSmall { font-size: 10pt; }',
		button_text_top_padding: 0,
		button_text_left_padding: 18,
		button_window_mode: SWFUpload.WINDOW_MODE.TRANSPARENT,
		button_cursor: SWFUpload.CURSOR.HAND,
		
		// Flash Settings
		flash_url : "<?php echo base_url() ; ?>js/swfupload/swfupload.swf",
		flash9_url : "<?php echo base_url() ; ?>js/swfupload/swfupload_fp9.swf",

		custom_settings : {
			upload_target : "divFileProgressContainer",
			thumbnail_height: 600,
			thumbnail_width: 600,
			thumbnail_quality: 80
		},
		
		// Debug Settings
		debug: false
	});
	
	$('#contenitore_caricamento_img').dialog();
	$('#contenitore_caricamento_img').dialog('close');
	
	$('#contenitore_modifica_gallery').dialog();
	$('#contenitore_modifica_gallery').dialog('close');
	
	$("#accordion").accordion({ autoHeight: false , active: 2});
	
	
	$("#elenco_amici").fcbkcomplete({
      json_url: "<?php echo base_url();?>/amici/elenco_amici",
      cache: true,
      filter_case: true,
      filter_hide: true,
		firstselected: true,
      //onremove: "testme",
		//onselect: "testme",
      filter_selected: true,
      newel: true        
   });	
   
  
 	gallery.init_dett_partners();
	ricerca.init();
});
</script>

